import java.util.Scanner;


class Employee{
int id;
String name;
double sal;
public Employee(int id,String name,double sal){
this.id=id;
this.name=name;
this.sal=sal;

}

public static void printInfo(Employee e1, Employee e2){
   System.out.println("name :"+emp.name);
}





public static Employee[] sort(Employee[] emp ){
     
int n=emp.length;
Employee temp=null;
for(int i=0;i<n;i++){
  for(int j=1;j<(n-i);j++){
    if(emp[j-1].id>emp[j].id)
	{
	  temp=emp[j-1];
	  emp[j-1]=emp[j];
	  emp[j]=temp;
	  }
	  }
	  }
return emp;
}


public static void printEmp(Employee[] emp){
  for(int i=0;i<emp.length;i++)
{
   System.out.println("---ID---------Name----------Salary--");
   System.out.println(emp[i].id+ " " +emp[i].name+" "+emp[i].salary);
  }
}
}

public class EmpSort{
public static void main(String[] args){

Scanner in=new Scanner(System.in);
Employee[] emp=new Employee[3];  
int id=0;
double sal=0.0;
String name=null;
System.out.println("Enter 5 Employee id and names ");

for(int i=0;i<3;i++){

System.out.print("ID of Employee"+i+":" );
id=in.nextInt();

System.out.print("Name of Employee "+i+":" );
name=in.next();

System.out.print(" Salary of Employee"+ i +":" );
sal=in.nextFloat();

 emp[i]=new Employee(id,name,sal);

}


 System.out.println( "----- List Of Employeee Before SORT ------ ");

  Employee.printEmp(emp);
  Employee[] sort=Employee.sort(emp);
 System.out.println( "----- List Of Employeee After SORT ------ ");
  Employee.printEmp(sort);


System.out.print(" Enter Employee Id to get all details  : " );
id=in.nextInt();
Employee.printInfo(id);



  }
  }
  